<?php
$indexPath = 'index.html';
$iscreate = isset($_GET['create']) ? intval($_GET['create']) : false;

$LABEL_FONT = 'font';
$LABEL_JS = 'js';
$LABEL_CSS = 'css';
$LABEL_FRAME = 'frame'; // 框架

// 基本的引用路径 正式发布使用gitee地址
$basePath = $iscreate ? 'https://634174214.gitee.io/lib-wubin-work/' : '';

if ($iscreate) {
     ob_start();
} 

$lists = [
    [
        'title' => 'fontawesome字体合集',
        'href' => 'font/fontawesome/index.html',
        'label' => $LABEL_FONT
    ],
    [
        'title' => '纯css-icon引用',
        'href' => 'font/css-icon/icon-css/index.html',
        'label' => $LABEL_CSS
    ],
    [
        'title' => '纯css-icon(张鑫旭版推荐)',
        'href' => 'font/css-icon/zhangxinxu/index.html',
        'label' => $LABEL_CSS
    ],
    [
        'title' => 'Line-icon字体合集',
        'href' => 'font/lineicon/index.html',
        'label' => $LABEL_FONT
    ],
    [
        'title' => '思源宋体网页引用',
        'href' => 'font/siyuan/index.html',
        'label' => $LABEL_FONT
    ],
    [
        'title' => 'VConsole手机调试插件',
        'href' => 'js/vconsole/index.html',
        'label' => $LABEL_JS
    ],
    [
        'title' => 'LABjs轻量级加载器',
        'href' => 'js/labjs/index.html',
        'label' => $LABEL_JS
    ],
    [
        'title' => 'JQuery',
        'href' => 'js/jquery/index.html',
        'label' => $LABEL_JS
    ],
    [
        'title' => 'Layer(JQ)弹层组件',
        'href' => 'js/layer/index.html',
        'label' => $LABEL_JS
    ],
    [
        'title' => 'Bootstrap',
        'href' => 'js/bootstrap/index.html',
        'label' => $LABEL_FRAME
    ],
    [
        'title' => 'axios高效的http库',
        'href' => 'js/axios/index.html',
        'label' => $LABEL_JS
    ],
    [
        'title' => 'vconsole微信手机调试',
        'href' => 'js/vconsole/index.html',
        'label' => $LABEL_JS
    ],
    [
        'title' => 'vue-scrollto兼容的滚动库',
        'href' => 'js/vue-scrollto/index.html',
        'label' => $LABEL_JS
    ],
    [
        'title' => 'animate齐全的CSS3动画库',
        'href' => 'css/animate/index.html',
        'label' => $LABEL_CSS
    ],
    [
        'title' => 'MarkDown文档排列',
        'href' => 'js/markdown-html2doc/index.html',
        'label' => $LABEL_JS
    ],
    [
        'title' => 'IE兼容响应式与HTML5标签',
        'href' => 'js/ie/index.html',
        'label' => $LABEL_JS
    ],
    [
        'title' => 'html2canvas前端截图',
        'href' => 'js/html2canvas/index.html',
        'label' => $LABEL_JS
    ],
    [
        'title' => 'vue',
        'href' => 'js/vue/index.html',
        'label' => $LABEL_JS
    ],
    [
        'title' => 'jszip压缩',
        'href' => 'js/jszip/index.html',
        'label' => $LABEL_JS
    ],
    [
        'title' => 'filesaver使用JS保存文件的库',
        'href' => 'js/file-saver/index.html',
        'label' => $LABEL_JS
    ]
];
?>

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
    <title>肆库-常用的各类前端开发资源库 | wubin.work</title>
    <meta name="keywords" content="肆库,开发,资源库,前端,css,js，">
    <meta name="description" content="肆库是一个常用的各类前端开发资源库。肆库分为CSS、JS、各类框架、字体，是一个整合了常用各类资源的集合。">
    <link rel="shortcut icon" href="favicon.ico" type="image/x-icon">
    <link rel="stylesheet" href="<?php echo $basePath; ?>assets/css/index-pc.css" media="(min-width: 641px)">
    <link rel="stylesheet" href="<?php echo $basePath; ?>assets/css/index-m.css" media="(max-width:640px)">
    <!--#include virtual="/ssi/baidu-hm.html"-->
</head>
<body>
    <div class="left-aside">
        <div class="top-search" id="top-search">
            <div class="top-search-input">
                <input type="text" placeholder="请输入要检索的库" id="search-input">
            </div>
            <div class="top-search-help-x">
                <img src="<?php echo $basePath; ?>assets/img/index-logo.png">
                <a href="https://www.bootcdn.cn/" target="_blank">bootcdn</a>
                <a href="https://cdnjs.com/" target="_blank">cdnjs</a>
                <a href="https://unpkg.com/" target="_blank">unpkg</a>
            </div>
        </div>
        <ul class="left-list" id="left-list">
            <?php foreach ($lists as $key => $item) { ?>
                <li data-search="<?php echo $item['title']; ?>">
                    <a href="<?php echo $item['href']; ?>" target="iframe" class="list-a" title="<?php echo $item['title']; ?>">
                        <p class="<?php echo $item['label'] ?>"><?php echo $item['title']; ?></p>
                    </a>
                </li>
            <?php } ?>
        </ul>
    </div>
    <div class="right-aside">
        <iframe frameborder="0" id="iframe" name="iframe"></iframe>
    </div>

    <script src="http://www.qdxin.cn/js/xinquery.js"></script>
    <script src="<?php echo $basePath; ?>assets/js/index-run.js"></script>
</body>
</html>

<?php
    if ($iscreate) {
       file_put_contents($indexPath, ob_get_clean());
    }
?>